package org.huang.user.consumer.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import org.huang.user.api.UserService;
import org.huang.user.entity.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @描述：UserTestController类描述
 * @作者: huanganwei
 * @创建时间: 2018-08-08 23:44:44
 * @版本: 1.0
 */
@RestController
@RequestMapping("/user")
public class UserTestController {

    @Reference(version = "1.0.0",loadbalance ="roundrobin" )
    private UserService userService;

    @GetMapping("/{id}")
    public User getUserById(@PathVariable Integer id) {
        return userService.getUserById(id);
    }
}
